home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / misc / xpdf_0.8 / archive / xpdf-0.8-src.lha / xpdf-0.8-src / configure.in < prev    next >
Text File  |  1998-11-28  |  4KB  |  159 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(xpdf/xpdf.cc)
  3.  
  4. dnl ##### Optional features.
  5. OPTIONS=""
  6. AC_ARG_ENABLE(a4-paper,
  7. [  --enable-a4-paper       use A4 paper size instead of Letter for
  8.                           PostScript output],
  9. OPTIONS="$OPTIONS -DA4_PAPER")
  10. AC_ARG_ENABLE(japanese,
  11. [  --enable-japanese       enable Japanese font support],
  12. OPTIONS="$OPTIONS -DJAPANESE_SUPPORT")
  13. AC_ARG_ENABLE(no-text-select,
  14. [  --enable-no-text-select do not allow text selection],
  15. OPTIONS="$OPTIONS -DNO_TEXT_SELECT")
  16. AC_ARG_WITH(gzip,
  17. [  --with-gzip             use gzip instead of uncompress],
  18. OPTIONS="$OPTIONS -DUSE_GZIP")
  19. AC_SUBST(OPTIONS)
  20.  
  21. dnl ##### Checks for programs.
  22. AC_PROG_CC
  23. AC_ISC_POSIX
  24. AM_PROG_CC_STDC
  25. #if test -z "$CXX" -a "$CC" = "gcc"; then
  26. #  CXX="gcc"
  27. #fi
  28. AC_PROG_CXX
  29. AC_PROG_INSTALL
  30. AC_PROG_RANLIB
  31. AC_CHECK_PROG(STRIP, strip, strip, :)
  32.  
  33. dnl ##### Check for OS/2.
  34. AC_CACHE_CHECK([for OS/2 (with EMX)],
  35. xpdf_cv_sys_os2,
  36. [AC_TRY_COMPILE([],
  37. [__EMX__],
  38. xpdf_cv_sys_os2=yes, xpdf_cv_sys_os2=no)])
  39. if test "$xpdf_cv_sys_os2" = yes; then
  40.   EXE=".exe"
  41.   LIBPREFIX=""
  42.   AR="ar -rc"
  43. else
  44.   EXE=""
  45.   LIBPREFIX="lib"
  46.   AR="ar rc"
  47. fi
  48. AC_SUBST(EXE)
  49. AC_SUBST(LIBPREFIX)
  50. AC_SUBST(AR)
  51.  
  52. dnl ##### Checks for header files.
  53. AC_PATH_XTRA
  54. AC_HEADER_DIRENT
  55.  
  56. dnl ##### Look for header that defines fd_set.
  57. AC_MSG_CHECKING([fd_set and sys/select.h or sys/bsdtypes.h])
  58. AC_TRY_COMPILE([#include <sys/types.h>],
  59.   [fd_set fds;], xpdf_ok=yes, xpdf_ok=no)
  60. if test $xpdf_ok = yes; then
  61.   AC_MSG_RESULT([not needed])
  62. else
  63.   AC_TRY_COMPILE([#include <sys/types.h>
  64. #include <sys/select.h>],
  65.     [fd_set fds;], xpdf_ok=yes, xpdf_ok=no)
  66.   if test $xpdf_ok = yes; then
  67.     AC_DEFINE(HAVE_SYS_SELECT_H)
  68.     AC_MSG_RESULT([need sys/select.h])
  69.   else
  70.     AC_TRY_COMPILE([#include <sys/types.h>
  71. #include <sys/bsdtypes.h>],
  72.       [fd_set fds;], xpdf_ok=yes, xpdf_ok=no)
  73.     if test $xpdf_ok = yes; then
  74.       AC_DEFINE(HAVE_SYS_BSDTYPES_H)
  75.       AC_MSG_RESULT([need sys/bsdtypes.h])
  76.     else
  77.       AC_MSG_RESULT([problem])
  78.     fi
  79.   fi
  80. fi
  81.  
  82. dnl ##### Look for header that defines FD_ZERO.
  83. AC_MSG_CHECKING([FD_ZERO and strings.h or bstring.h])
  84. AC_TRY_COMPILE([#include <sys/types.h>
  85. #ifdef HAVE_SYS_SELECT_H
  86. #include <sys/select.h>
  87. #endif],
  88. [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
  89. if test $xpdf_ok = yes; then
  90.   AC_MSG_RESULT([not needed])
  91. else
  92.   AC_TRY_COMPILE([#include <sys/types.h>
  93. #include <strings.h>
  94. #ifdef HAVE_SYS_SELECT_H
  95. #include <sys/select.h>
  96. #endif],
  97.     [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
  98.   if test $xpdf_ok = yes; then
  99.     AC_DEFINE(HAVE_STRINGS_H)
  100.     AC_MSG_RESULT([need strings.h])
  101.   else
  102.     AC_TRY_COMPILE([#include <sys/types.h>
  103. #include <bstring.h>
  104. #ifdef HAVE_SYS_SELECT_H
  105. #include <sys/select.h>
  106. #endif],
  107.       [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
  108.     if test $xpdf_ok = yes; then
  109.       AC_DEFINE(HAVE_BSTRING_H)
  110.       AC_MSG_RESULT([need bstring.h])
  111.     else
  112.       AC_MSG_RESULT([problem])
  113.     fi
  114.   fi
  115. fi
  116.  
  117. dnl ##### Look for rewinddir.
  118. AC_CHECK_FUNCS(rewinddir)
  119. if test $ac_cv_func_rewinddir = no; then
  120.   AC_CHECK_LIB(cposix, rewinddir)
  121. fi
  122.  
  123. dnl ##### Checks for library functions.
  124. AC_CHECK_FUNCS(popen)
  125.  
  126. dnl ##### Check select argument type: on HP-UX before version 10, select
  127. dnl ##### takes (int *) instead of (fd_set *).
  128. AC_LANG_CPLUSPLUS
  129. AC_CACHE_CHECK([whether select takes fd_set arguments],
  130. xpdf_cv_func_select_arg,
  131. [AC_TRY_COMPILE([#include <sys/types.h>
  132. #include <sys/time.h>
  133. #ifdef HAVE_SYS_SELECT_H
  134. #include <sys/select.h>
  135. #endif],
  136. [fd_set fds;
  137. select(1, &fds, &fds, &fds, 0);],
  138. xpdf_cv_func_select_arg=yes, xpdf_cv_func_select_arg=no)])
  139. if test "$xpdf_cv_func_select_arg" != yes; then
  140.   AC_DEFINE(SELECT_TAKES_INT)
  141. fi
  142. AC_LANG_C
  143.  
  144. dnl ##### Check for libXpm.
  145. smr_CHECK_LIB(Xpm, Xpm, [pixmap library, used only for icon], 
  146.               XpmCreatePixmapFromData, X11/xpm.h,
  147.               $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS)
  148. AC_SUBST(Xpm_LIBS)
  149. AC_SUBST(Xpm_CFLAGS)
  150.  
  151. dnl ##### Write the makefiles.
  152. AC_OUTPUT(Makefile xpdf/Makefile ltk/Makefile goo/Makefile)
  153.  
  154. dnl ##### Warn user if X is missing.
  155. if test -n "$no_x"; then
  156.   AC_MSG_WARN([Couldn't find X -- you will be able to compile
  157.         pdftops, pdftotext, and pdfinfo, but not xpdf])
  158. fi
  159.